//
// Created by jiaxv on 25-8-12.
//

#include "interface/ground.h"



static field_desc g1_g3_init_as_fields[] = {
    {ft_set, 8, "GTYPE", NULL},
    {ft_set, 4, "VERSION", NULL},
    {ft_set, 12, "AS SAC", NULL},
    {ft_set, 28, "AS UA", NULL},
    {ft_set, 12, "GS SAC", NULL},
    {ft_set, 4, "ELEMENT TYPE", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_dl_str, 0, "SDU", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g1_g3_init_as_desc = {"G1 INIT AS", g1_g3_init_as_fields};

static field_desc g1_g3_snf_upload_fields[] = {
    {ft_set, 8, "GTYPE", NULL},
    {ft_set, 4, "VERSION", NULL},
    {ft_set, 12, "AS SAC", NULL},
    {ft_set, 4, "ELEMENT TYPE", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_dl_str, 0, "SDU", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g1_g3_snf_pkt_desc = {"G1 G3 SNF UPLOAD", g1_g3_snf_upload_fields};

static field_desc g1_g3_snf_download_fields[] = {
    {ft_set, 8, "GTYPE", NULL},
    {ft_set, 4, "VERSION", NULL},
    {ft_set, 12, "AS SAC", NULL},
    {ft_set, 4, "ELEMENT TYPE", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_dl_str, 0, "SDU", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g1_g3_snf_download_desc = {"G1 G3 SNF DOWNLOAD", g1_g3_snf_download_fields};

static field_desc g3_g5_as_auz_info_fields[] = {
    {ft_set, 8, "GTYPE", NULL},
    {ft_set, 4, "VERSION", NULL},
    {ft_set, 12, "AS SAC", NULL},
    {ft_set, 4, "IS LEGAL", NULL},
    {ft_set, 4, "AUZ TYPE", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g3_g5_as_auz_info_desc = {"G3 G5 AS AUZ INFO", g3_g5_as_auz_info_fields};

static field_desc g1_g5_bearer_est_fields[] = {
    {ft_set, 8, "GTYPE", NULL},
    {ft_set, 4, "VERSION", NULL},
    {ft_set, 12, "AS SAC", NULL},
    {ft_set, 4, "ELEMENT TYPE", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_dl_str, 0, "SNF", NULL},
    {ft_fl_str, 0, "IP", &(pk_fix_length_t){.len = GEN_ADDRLEN}},
    {ft_set, 16, "PORT", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g1_g5_bearer_est_desc = {"G1 G5 BEARER EST REQUEST", g1_g5_bearer_est_fields};

static field_desc g7_bearer_command_fields[] = {
    {ft_set, 8, "GTYPE", NULL},
    {ft_set, 4, "VERSION", NULL},
    {ft_set, 12, "AS SAC", NULL},
    {ft_set, 4, "CMD TYPE", NULL},
    {ft_set, 4, "Service", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_dl_str, 0, "SDU", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g7_bearer_command_desc = {"G7 BEARER COMMAND", g7_bearer_command_fields};

static field_desc g7_bearer_command_type1_fields[] = {
    {ft_fl_str, 0, "IP AS", &(pk_fix_length_t){.len = GEN_ADDRLEN}},
    {ft_fl_str, 0, "IP GS", &(pk_fix_length_t){.len = GEN_ADDRLEN}},
    {ft_set, 16, "PORT GS", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g7_bearer_command_type1_desc = {"G7 BEARER COMMAND TYPE 1", g7_bearer_command_type1_fields};

static field_desc g7_bearer_command_type2_fields[] = {
    {ft_fl_str, 0, "IP GS", &(pk_fix_length_t){.len = GEN_ADDRLEN}},
    {ft_set, 16, "PORT GS", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g7_bearer_command_type2_desc = {"G7 BEARER COMMAND TYPE 2", g7_bearer_command_type2_fields};

static field_desc g7_bearer_complete_fields[] = {
    {ft_set, 8, "GTYPE", NULL},
    {ft_set, 4, "VERSION", NULL},
    {ft_set, 12, "AS SAC", NULL},
    {ft_set, 4, "MNG FLAG", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g7_bearer_complete_desc = {"G7 BEARER COMPLETED", g7_bearer_complete_fields};

static field_desc g1_g3_g5_as_st_chg_fields[] = {
    {ft_set, 8, "GTYPE", NULL},
    {ft_set, 4, "VERSION", NULL},
    {ft_set, 12, "AS SAC", NULL},
    {ft_set, 4, "STATE", NULL},
    {ft_set, 12, "GS SAC", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g1_g3_g5_as_st_chg_desc = {"G3 G5 AS STATE CHANGE", g1_g3_g5_as_st_chg_fields};

static field_desc g1_g5_as_release_exit_fields[] = {
    {ft_set, 8, "GTYPE", NULL},
    {ft_set, 4, "VERSION", NULL},
    {ft_set, 12, "AS SAC", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g1_g5_as_release_exit_desc = {"G1 G5 AS RELEASE EXIT", g1_g5_as_release_exit_fields};

static field_desc g1_handover_request_fields[] = {
    {ft_set, 8, "GTYPE", NULL},
    {ft_set, 4, "VERSION", NULL},
    {ft_set, 12, "AS SAC", NULL},
    {ft_set, 28, "AS UA", NULL},  //////////////////////////////// 为统一GSG的处理 添加
    {ft_set, 12, "GSS SAC", NULL},
    {ft_set, 12, "GST SAC", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g1_handover_request_desc = {"G1 HANDOVER REQUEST", g1_handover_request_fields};

static field_desc g1_g3_key_update_remind_fields[] = {
    {ft_set, 8, "GTYPE", NULL},
    {ft_set, 4, "VERSION", NULL},
    {ft_set, 12, "AS SAC", NULL},
    {ft_set, 4, "ELEMENT TYPE", NULL},
    {ft_set, 12, "GSS SAC", NULL},
    {ft_set, 12, "GST SAC", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g1_g3_key_update_remind_desc = {"G1 G3 KEY UPDATE REMIND", g1_g3_key_update_remind_fields};

static field_desc g1_g5_path_switch_fields[] = {
    {ft_set, 8, "GTYPE", NULL},
    {ft_set, 4, "VERSION", NULL},
    {ft_set, 12, "AS SAC", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_fl_str, 0, "IP", &(pk_fix_length_t){.len = GEN_ADDRLEN}},
    {ft_set, 16, "PORT", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g1_g5_path_switch_desc = {"G1 G5 PATH SWITCH", g1_g5_path_switch_fields};

static field_desc g1_ho_rqst_ack_fields[] = {
    {ft_set, 8, "GTYPE", NULL},
    {ft_set, 4, "VERSION", NULL},
    {ft_set, 12, "AS SAC", NULL},
    {ft_set, 9, "NEXT CO", NULL},
    {ft_pad, 0, "PAD", NULL},
    {ft_end, 0, NULL, NULL},
};
struct_desc_t g1_ho_rqst_ack_desc = {"G1 HO RQST ACK", g1_ho_rqst_ack_fields};
